home *** CD-ROM | disk | FTP | other *** search
/ Chip 2006 December / chip-cd_2006_12.zip / 12 / Pakiet internetowy / Stacje TV i radiowe (odsluchiwanie i rippowanie) / StationRipper 2.70c / StationRipperInst.exe / MM_AddTrack.vbs < prev    next >
Text File  |  2005-06-26  |  2KB  |  96 lines

  1.  
  2.     sMP3Path = Wscript.Arguments(0)
  3.     bAutoPlay = Wscript.Arguments(1)
  4.     sPlaylistName = Wscript.Arguments(2)
  5.     sPlaylistName2 = Wscript.Arguments(3)
  6.     sPlaylistName3 = Wscript.Arguments(4)
  7.     
  8.     
  9.     'WScript.Echo("Path=" & sMP3Path)
  10.     'WScript.Echo("List1 = " & sPlaylistName)
  11.     'WScript.Echo("List2 = " & sPlaylistName2)
  12.     'WScript.Echo("List3 = " & sPlaylistName3)
  13.     'WScript.Echo("AutoPlay = " & bAutoPlay)
  14.  
  15.     Dim Tree
  16.  
  17.     Dim SDB            'As SongsDB.SDBApplication
  18.     Dim WSHShell
  19.     Dim sMMPath
  20.         
  21.     
  22.     '
  23.     ' Get a interface to the running MM
  24.     '
  25.     Set SDB = CreateObject("SongsDB.SDBApplication")
  26.     
  27.     If IsNull(SDB) Then
  28.         Return
  29.     End If
  30.         
  31.     '
  32.     ' Add the Song to the main DB.  Tell MM to figure out details about
  33.     ' the song.
  34.     '
  35.     Set songData = SDB.NewSongData
  36.     songData.Path = sMP3Path
  37.     songData.MetadataFromFilename
  38.     songData.ReadTags
  39.     songData.UpdateDB
  40.     
  41.     '
  42.     ' Start play song if needed
  43.     '
  44.     If bAutoPlay = "true" Then
  45.         SDB.Player.PlaylistClear
  46.         SDB.Player.CurrentSongIndex = 0
  47.         SDB.Player.PlaylistAddTrack (songData)
  48.         SDB.Player.Play
  49.     End If
  50.     
  51.     Dim playList' As SDBPlaylist
  52.     '
  53.     ' If a Playlist was passed, add the song to to the playlist
  54.     '
  55.     If Len(sPlaylistName) > 0 Then
  56.         Set Tree = SDB.MainTree
  57.         
  58.         Set playList = SDB.PlaylistByTitle(sPlaylistName)
  59.         
  60.         If IsNull(playList) Or Len(playList.Title) = 0 Then
  61.             Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName)
  62.         End If
  63.         
  64.         playList.AddTrack (songData)
  65.     End If
  66.         
  67.     
  68.     If Len(sPlaylistName2) > 0 Then
  69.         Set Tree = SDB.MainTree
  70.         
  71.         Set playList = SDB.PlaylistByTitle(sPlaylistName2)
  72.         
  73.         If IsNull(playList) Or Len(playList.Title) = 0 Then
  74.             Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName2)
  75.         End If
  76.         
  77.         playList.AddTrack (songData)
  78.     End If
  79.         
  80.  
  81.     If Len(sPlaylistName3) > 0 Then
  82.         Set Tree = SDB.MainTree
  83.         
  84.         Set playList = SDB.PlaylistByTitle(sPlaylistName3)
  85.         
  86.         If IsNull(playList) Or Len(playList.Title) = 0 Then
  87.             Set playList = SDB.PlaylistByTitle("").CreateChildPlaylist(sPlaylistName3)
  88.         End If
  89.         
  90.         playList.AddTrack (songData)
  91.     End If
  92.     
  93.     
  94.  
  95.  
  96.